package com.itheima.oopadvanced.util;

/**
 * @author Anomaly
 * @date 2022/12/9 11:52
 */

/**
 *
 */
public class ArrayUtil {
    private ArrayUtil() {
    }

    public static String toString(int arr[]) {
        if (arr == null) {
            return null;
        }
        String s = "[";
        for (int i = 0; i < arr.length; i++) {
            s += (i == (arr.length - 1) ? arr[i] : arr[i] + ", ");
        }
        s += "]";
        return s;
    }

}
